forum

home / developersection / forums / wpf window not closing

WPF window not closing

Anonymous User 2250 19-Jul-2013

I want to close a window in WPF but it is not close below I am providing you the code sample which I use for closing the window.

public partial class MainWindow : Window
{
    private WorkflowRuntime wfRuntime = new WorkflowRuntime();
    public MainWindow()
    {
        InitializeComponent();
        wfRuntime.WorkflowTerminated += (se, ev) => this.Close(); // this doesn't close the window
        wfRuntime.WorkflowCompleted += (se, ev) => this.Close();
    }
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        WorkflowInstance launcherWorkflow = wfRuntime.CreateWorkflow(typeof(InstallerWorkflow));
        launcherWorkflow.Start();
    }
}


wpf wpf 
Updated on 19-Jul-2013

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By